<?php
use Illuminate\Routing\Router;
Route::group([
    'prefix'        => config('admin.route.prefix'),       // admin
	'namespace'     => '\App\Admin\Controllers',
    'middleware'    => config('admin.route.middleware'),   //['web', 'admin']
], function (Router $router) {
		//应用管理
		$router->post('app/restore', 'AppController@restore')->name('admin.app.restore');
		$router->get('app/{id}/set', 'AppController@set')->name('admin.app.set');
		$router->resource('app', 'AppController')->names('admin.app');

		//应用分类
		$router->resource('app/{xapp_id}/cate', 'CateController')->names('admin.app.cate');
		$router->get('app/{xapp_id}/cate/{id}/set', 'CateController@set')->name('admin.app.cate.set');


		//应用
		$router->get('xapps/{xapp}', 'XappsController@index')->name('admin.xapps.index');
		$router->get('xapps/{xapp}/create', 'XappsController@create')->name('admin.xapps.create');
		$router->get('xapps/{xapp}/{id}', 'XappsController@show')->name('admin.xapps.show');
		$router->get('xapps/{xapp}/{id}/edit', 'XappsController@edit')->name('admin.xapps.edit');
		$router->post('xapps/{xapp}', 'XappsController@store')->name('admin.xapps.store');
		$router->put('xapps/{xapp}/{id}', 'XappsController@update')->name('admin.xapps.update');
		$router->delete('xapps/{xapp}/{id}', 'XappsController@destroy')->name('admin.xapps.destroy');
		$router->post('xapps/{xapp}/change', 'XappsController@change')->name('admin.xapps.change');
		$router->post('xapps/{xapp}/restore', 'XappsController@restore')->name('admin.xapps.restore');


		$router->get('test', 'ExampleController@index');


		$router->get('api/get_cate_groups', 'Api\XappController@get_cate_groups')->name('admin.api.get_cate_groups');

		$router->get('api/china/city', 'China\ChinaController@city');
		$router->get('api/china/district', 'China\ChinaController@district');
});


Route::fallback(function () {
    return '404!';//
});